package com.example.demo.OneToMany.service.Impl;


import com.example.demo.OneToMany.entity.Teacher;
import com.example.demo.OneToMany.repository.TeacherRepository;
import com.example.demo.OneToMany.service.TeacherService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherRepository teacherRepository;

    @Override
    public List<Teacher> getTeacherlist() {
        return teacherRepository.findAll();
    }

    @Override
    public Teacher findTeacherById(long id) {
        return teacherRepository.findById(id);
    }
}
